package com.ftg.learn.chapter08.pattern.proxy.image1;

import lombok.Data;

/**
 * 美颜照片
 *
 * @author lijiaxin
 * @version 1.0
 * @date 2023/8/4 10:33
 */
@Data
public class ProxyImage implements Image{

    private Reallmage reallmage;
    private String fileName;

    public ProxyImage(String fileName){
        this.fileName=fileName;
    }

    @Override
    public void display() {
        if(reallmage == null){
            reallmage = new Reallmage(fileName);
        }
        reallmage.display();
        System.out.println(fileName+"显示美颜照片");
    }
}
